include ../ffox.mk

TARGET = $(NAME).bin

CSRCS=	ffox.c \
	blinker.c \
	analogin.c \
	serial.c \
	servo.c \
	receiver.c \
	twi.c \
	twid.c \
	i2c.c \
	hp03.c \
	timer.c \
	sensor.c \
	dbgprintf.c \
	Cstartup_SAM7.c

ASMSRCS=boot.s

LIBS=	../FreeRTOS/librtos.a ../usb/libusb.a ../nav/libnav.a ../picoc/libpicoc.a

OBJS := $(CSRCS:%.c=%.o) $(ASMSRCS:%.s=%.o)

all: $(TARGET)

$(TARGET): $(OBJS) atmel-rom.ld $(LIBS)
	$(LD) $(LFLAGS) -o $(NAME).out $(OBJS) $(LIBS) libc.a libm.a libgcc.a 
	$(OBJCP) $(OBJCPFLAGS) $(NAME).out $(TARGET)

clean:
	rm -f $(TARGET) $(OBJS)

depend:
	$(CC) $(CFLAGS) -MM $(CSRCS) >.depend

-include .depend

